package com.sans.start;

import org.junit.Test;

import java.math.BigDecimal;

/**
 * @author Sans
 */
public class BasicTypeTest {
    @Test
    public void byteType(){
        byte numA = 99;
        System.out.println(numA);

        short numB = 9999;
        System.out.println(numB);

        int numC = 999999999;
        System.out.println(numC);

        long numD = 999999999999999999L;
        System.out.println(numD);

        System.out.println(1111111111111111111L);
    }
    @Test
    public void floatType(){
        System.out.println(5.00 - 3.70);
        System.out.println(new BigDecimal("59.74385").subtract(new BigDecimal("33.37064")));

        double numA = 7.899137585649671;
        System.out.println(numA);

        float numB = 8.57F;
        System.out.println(numB);

    }
    @Test
    public void charType(){
        char wordA = 'a';
        System.out.println(wordA);
        char wordB = 65;
        System.out.println(wordB);
    }
    @Test
    public void booleanType(){
        boolean flag = true;
        System.out.println(flag);
        flag = false;
        System.out.println(flag);
    }
    @Test
    public void typeConversion(){
        int numA = 100;
        long numB = numA;
        System.out.println(numA);
        System.out.println(numB);

        long numC = 97L;
        char numD = (char)numC;
        System.out.println(numC);
        System.out.println(numD);

        int numE = 100;
        double numF = numE;
        System.out.println(numE);
        System.out.println(numF);

        double numG = 3.99;
        int numH = (int)numG;
        System.out.println(numG);
        System.out.println(numH);

        char wordA = 'a';
        double result = wordA;
        System.out.println(wordA);
        System.out.println(result);
    }
    @Test
    public void calculation(){
        int numA = 10;
        long numB = 100L;
        int result = (int)(numA+numB);
        System.out.println(result);

        char word = 'a';
        System.out.println(word+10);
    }
}
